<?php


namespace App\Jobs;


use Hhxsv5\LaravelS\Swoole\Task\Task;
use Illuminate\Support\Facades\Log;

class TestTask extends Task
{

    private $data;
    private $result;

    public function __construct($data)
    {
        $this->data = $data;
    }

    public function handle()
    {
        Log::info(__CLASS__ . ":开始处理任务",[$this->data]);
//        TODO:: 在这里处理事情
        sleep(3);
        $this->result = "任务处理完毕" . $this->data . "是66666";
    }

    /**
     * 任务处理完毕回调
     */
    public function finish()
    {
        Log::info(__CLASS__ . ":任务处理完成",[$this->result]);
    }
}